@echo off

set CFLAGS=-c -g -O2 -Wall -IC:\Python27\include -IC:\Python27\Lib\site-packages\numpy\core\include
set LFLAGS=-lpython27 -LC:\Python27\libs

echo Loesche bereits kompilierte Dateien.
del *.o TimeTagger _TimeTagger.so *~ *pyc TimeTagger_wrap.cxx gmon.out TimeTagger.py

echo Erstelle Python Interface
swig -Wall -c++ -python TimeTagger.i
g++ %CFLAGS% TimeTagger_wrap.cxx

echo Kompiliere Iteratoren
g++ %CFLAGS% Histogram.cpp
g++ %CFLAGS% Iterator.cpp
g++ %CFLAGS% Pulsed.cpp
g++ %CFLAGS% CountBetweenMarkers.cpp
g++ %CFLAGS% Counter.cpp

echo Kompiliere TimeTagger
g++ %CFLAGS% okFrontPanelDLL.cpp
g++ %CFLAGS% TimeTagger.cpp
g++ %CFLAGS% Thread.cpp -DTHREAD_USE_WINDOWS

echo Linke Python-Modul
g++ -shared TimeTagger_wrap.o okFrontPanelDLL.o TimeTagger.o Thread.o Histogram.o Iterator.o Pulsed.o CountBetweenMarkers.o Counter.o -o _TimeTagger.pyd %LFLAGS%
